﻿using System;

public class MemberAndNeighbours
{
    public static decimal[] array;

    public static void Main()
    {
        int index;

        array = Common.InputArray(array, "");
        index = Common.InputInteger(Common.InputArrayDescription(array, "") + "Index = ");
        Console.WriteLine(Result(index, array));
    }

    public static string Result(int index, decimal[] array)
    {
        switch (Check(index, array))
        {
            case 1: return string.Format("\nThe member on position {0} is bigger than its two neighbours!\n", index);
            case 0: return string.Format("\nThe member on position {0} is not bigger than its two neighbours!\n", index);
            case 2: return string.Format("\nThe member on position {0} is bigger than its unique neighbour!\n", index);
            case -3: return string.Format("\nThe member on position {0} is not bigger than its unique neighbour!\n", index);
            default: return string.Format("\nThere is no position {0} in this array!\n", index);
        }
    }

    public static int Check(int index, decimal[] array)
    {
        if ((0 < index) && (index < array.Length - 1))
        {
            if ((array[index - 1] < array[index]) && (array[index + 1] < array[index]))
                return 1;
            else
                return 0;
        }
        else if (index == 0)
        {
            if (array[1] < array[0])
                return 2;
            else
                return -3;
        }
        else if (index == array.Length - 1)
        {
            if (array[index - 1] < array[index])
                return 2;
            else
                return -3;
        }
        else
            return -4;
    }
}